package com.xbongbong.paas.service;

import com.xbongbong.paas.domain.entity.AttrTrashEntity;
import com.xbongbong.paas.enums.IndexTypeEnum;
import com.xbongbong.paas.pojo.dto.AttrTrashDeleteDTO;
import com.xbongbong.paas.pojo.dto.AttrTrashListDTO;
import com.xbongbong.paas.pojo.dto.AttrTrashRecoverDTO;
import com.xbongbong.paas.pojo.vo.AttrTrashDeleteVO;
import com.xbongbong.paas.pojo.vo.AttrTrashListVO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.BaseVO;
import com.xbongbong.paas.toolbox.wrap.UserVO;
import com.xbongbong.pro.domain.entity.UpdateDataEntity;
import com.xbongbong.pro.formdata.pojo.dto.FieldExistDataDTO;
import com.xbongbong.pro.formdata.pojo.vo.FieldExistDataVO;

import java.util.List;

/**
 * 字段回收站service
 * @author 魏荣杰
 * @date 2021/3/5 13:49
 * @since
 * @version
 */
public interface PaasFormAttrTrashService {

    /**
     * 字段是否存在值
     * @param fieldExistDataDTO
     * @return
     * @throws XbbException
     */
    FieldExistDataVO fieldExistData(FieldExistDataDTO fieldExistDataDTO) throws XbbException;

    /**
     * 关联产品是否可以删除
     * @param attr
     * @param businessType
     * @param subAttr
     * @param corpid
     * @param formId
     * @param fieldType
     * @return
     */
    boolean isProductSubKey(String attr, Integer businessType, String subAttr, String corpid, Long formId, Integer fieldType);

    /**
     * Description: 字段回收站列表
     * @param attrTrashListDTO
     * @return com.xbongbong.paas.pojo.vo.AttrTrashListVO
     * @throws
     * @author 魏荣杰
     * @date 2021/3/4 14:11
     * @since
     */
    AttrTrashListVO trashList(AttrTrashListDTO attrTrashListDTO) throws XbbException;

    /**
     * Description: 字段回收站恢复
     * @param attrTrashRecoverDTO
     * @return com.xbongbong.paas.pojo.vo.AttrTrashListVO
     * @throws
     * @author 魏荣杰
     * @date 2021/3/4 14:09
     * @since
     */
    BaseVO trashRecover(AttrTrashRecoverDTO attrTrashRecoverDTO) throws XbbException;

    /**
     * Description: 字段回收站删除
     * @param attrTrashDeleteDTO
     * @return com.xbongbong.paas.pojo.vo.AttrTrashListVO
     * @throws
     * @author 魏荣杰
     * @date 2021/3/4 14:10
     * @since
     */
    AttrTrashDeleteVO trashDelete(AttrTrashDeleteDTO attrTrashDeleteDTO) throws XbbException;
    /**
     * 记录产品数量
     * @param attr
     * @param subAttr
     * @param businessType
     * @param corpid
     * @param formId
     * @param fieldType
     * @return java.lang.Long
     * @author 吴峰
     * @date 2022/12/23 10:04
     * @throws XbbException
     */
    Long countProductNum(String attr, String subAttr, Integer businessType, String corpid, Long formId, Integer fieldType);
    /**
     * Description:
     * @param
     * @param loginUser
     * @return void
     * @throws
     * @author 魏荣杰
     * @date 2021/3/5 14:21
     * @since
     */
        void trashDeleteJobs(List<AttrTrashEntity> attrTrashEntityList, UserVO loginUser) throws XbbException;


    /**
     * Description:
     * @param attr
     * @param subAttr
     * @param businessType
     * @param corpid
     * @param formId
     * @param fieldType
     * @return java.lang.Long
     * @throws
     * @author 魏荣杰
     * @date 2021/3/16 15:36
     * @since
     */
    void deleteProductSubData(String attr, String subAttr, Integer businessType, String corpid, Long formId, Integer fieldType) throws XbbException;

    void updateSubData(List<UpdateDataEntity> updateList, String corpid, IndexTypeEnum indexTypeEnum) throws XbbException;

    void updateBatch(AttrTrashEntity trashEntity, String corpid, List<UpdateDataEntity> updateList) throws XbbException;
}
